<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Banner extends BaseModel {

	protected $table = 'banner';

	public $timestamps = false;

	protected $fillable = [
		'img_url',
		'status'
	];


	public function scopeStatus($query){

		return $query->where('status',self::NORMAL_STATUS);

	}

	/**
	 * 获取分类列表
	 */
	function get_banners(){
		return $this
				->status()
				->paginate(self::PAGESIZE);
	}

}
